package co.edu.usbcali.egrapico.vista.ambient;

import co.edu.usbcali.egrapico.vista.FrmPrincipal;
import co.edu.usbcali.egrapico.vista.tools.JPanelTranferHandlerPrecedentMsg;

public class LabelPrecedentMsg extends javax.swing.JLabel implements java.io.Serializable {

    PanelPrecedentMsg frame;
    String nameParent;
    boolean ban = false;//si no ha sido creado

    /**
     * Creates a new instance of LabelContext
     */
    public LabelPrecedentMsg() {
        frame = new PanelPrecedentMsg();
        nameParent = "";
    }

    public PanelPrecedentMsg getFrame() {
        return frame;
    }

    public void setNameParent(String name) {
        nameParent = name;
    }

    public String getNameParent() {
        return nameParent;
    }

    public void setTitlePanel(String title) {
        frame.setTitle(title);
    }

    public String getTitlePanel() {
        return frame.getTitle();
    }

    public void mostrarPanel() {
        frame.setTitle(nameParent + ".PrecedentMsg");
        frame.setVisible(true);
        try {
            frame.setSelected(true);
        } catch (java.beans.PropertyVetoException e) {
        }
    }

    public void Ladicionar() {
        frame.setTransferHandler(new JPanelTranferHandlerPrecedentMsg());
        frame.setTitle(nameParent + ".PrecedentMsg");
        FrmPrincipal.addElementtoDesKtop(frame);
        frame.setVisible(true);
        try {
            frame.setSelected(true);
        } catch (java.beans.PropertyVetoException e) {
        }
        ban = true;
    }

    public boolean isCreate() {
        return ban;
    }
}